package org.gitos.cloud.domain.device;

import java.io.Serializable;

import org.gitos.cloud.domain.tcp.DeviceId;

/**
 * Created by shizhengchu on 16/1/19.
 */
public class Device implements Serializable {

	private static final long serialVersionUID = -2643603727672632724L;

	private DeviceId deviceId = new DeviceId();
	private String nodeId = "";
	private String channelId = "";
	private boolean isLogin=false;

	public static final int OTA_NONE = 0;//未有过OTA
	public static final int OTA_ASK = 1;//服务器请求OTA
	public static final int OTA_ALLOWED = 2;//设备允许OTA
	public static final int OTA_NOT_ALLOWED = 3;//设备允许OTA
	public static final int OTA_TRANSFER = 4;//服务器发送rom文件
	public static final int OTA_SUCCESS = 5;//设备完成OTA
	public static final int OTA_FAIL = 6;//设备完成OTA

	private int otaState=OTA_NONE;

	public int getOtaState() {
		return otaState;
	}

	public void setOtaState(int otaState) {
		this.otaState = otaState;
	}

	public boolean isLogin() {
		return isLogin;
	}

	public void setLogin(boolean login) {
		isLogin = login;
	}

	public DeviceId getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(DeviceId deviceId) {
		this.deviceId = deviceId;
	}

	public String getNodeId() {
		return nodeId;
	}

	public void setNodeId(String nodeId) {
		this.nodeId = nodeId;
	}

	public String getChannelId() {
		return channelId;
	}

	public void setChannelId(String channelId) {
		this.channelId = channelId;
	}
}
